#ifndef MODBUS_REG_H_
#define MODBUS_REG_H_

#include "data_type.h"


	#define	DI_TYPE_DIS				        	0u  //无输入
	#define	DI_TYPE_EMRG_DUAL			      1u  //急停按钮双通道
	#define	DI_TYPE_EMRG_SINGLE			    2u  //急停按钮单通道
	#define	DI_TYPE_SAFE_DOOR_DUAL	  	3u  //安全门双通道
	#define	DI_TYPE_SAFE_DOOR_SINGLE	  4u  //安全门单通道
	#define	DI_TYPE_SAFE_MAT			      5u  //安全地毯
	#define	DI_TYPE_MAGNETIC			      6u  //磁性开关
	#define	DI_TYPE_SAFE_CURTAIN		    7u  //安全光幕
	#define	DI_TYPE_TWO_HAND		      	8u  //双手按钮
	#define	DI_TYPE_RST_SINGLE			    9u  //单通道复位按钮
	#define	DI_TYPE_RST_DUAL			      10u //双通道复位按钮
	#define	DI_TYPE_HBS 					      11u //心跳传感器
	#define DI_TYPE_EMGR_DUAL_NO_PULSE  12u //急停按钮双通道无脉冲检测
	#define	DI_TYPE_SWITCH 			        13u  //选择开关
	#define DI_TYPE_EMGR_DUAL_NO_BALANCE  14u //急停按钮双通道无通道平衡检测
	#define DI_TYPE_MAGNETIC_NO_BALANCE  	15u //磁性开关无通道平衡检测
	#define DI_TYPE_SAFE_CURTAIN_SINGLE   16u //单通道安全光幕
	#define DI_TYPE_SAFE_DOOR_SINGLE_PNP	17u //单通道安全门(PNP)
	#define DI_TYPE_SAFE_DOOR_DUAL_PNP	  18u //双通道安全门(PNP)
	#define DI_TYPE_MAGNETIC_PNP	        19u //磁性开关(PNP)
	#define DI_TYPE_LIMIT_SWITCH_SINGLE	  23u //单通道限位开关
	#define DI_TYPE_LIMIT_SWITCH_DUAL_1NC_1NO	 24u //双通道限位开关(1NC+1NO)
	#define DI_TYPE_LIMIT_SWITCH_DUAL_2NC   	 25u //双通道限位开关(2NC)
	
	#define	LOGIC_DIS					    0u  //无逻辑
	#define	LOGIC_AANDB			      101u  //A&B
	#define	LOGIC_AANDBANDC			  102u  //A&B&C
	#define	LOGIC_AORB		        103u  //A|B
	#define	LOGIC_AORBORC	        104u  //A|B|C
	#define	LOGIC_NOTA			      105u  //!A
	#define	LOGIC_TWOHAND			    106u  //双手按钮
	#define	LOGIC_RST_LTH		      107u  //上升沿触发
	#define	LOGIC_RST_HTL			    108u  //下降沿触发
	#define	LOGIC_RST_HTH			    109u  //高电平触发
	#define	LOGIC_DELAYON			    110u //延时启动
	#define	LOGIC_DELAYOFF				111u //延时断开
	#define	LOGIC_AXNORB				  112u //同或
	#define	LOGIC_AXORB				    113u //异或
//	#define	LOGIC_FRE_MONITOR			114u //频率量监控
	#define LOGIC_FRE_OUT         115u //频率输出
	#define	LOGIC_HBS				      116u //心跳监控
	
	#define	BF_DIAG1_MCU	0x01u  //MCU执行故障，
	#define	BF_DIAG1_DRAM	0x02u  //双口RAM比较故障
	#define	BF_DIAG1_COMM	0x04u  //SPI通讯故障
	#define	BF_DIAG1_PRG	0x08u  //FLASH 故障
	#define	BF_DIAG1_CRAM	0x10u  //RAM中组态数据校验故障
	#define	BF_DIAG1_PWR	0x20u  //电源电压故障
	#define	BF_DIAG1_CWR	0x40u  //线圈电压故障
	

#endif
